/****************************************************
          File Name:posix_ipc.h
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Sat 20 Sep 2014 08:41:24 AM CST
*****************************************************/

#include<stdio.h>
#include<fcntl.h>
#include<stdlib.h>
#include<mqueue.h>      /* message queue */
#include<sys/stat.h>
#include<unistd.h>
#include<string.h>
#include<sys/mman.h>         /* shared memery */
#include<errno.h>
#include<semaphore.h>    /* semapore */

#define MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP)

void Usage(int argc, char *arg, char *para1, char *para2)
{
	if(argc<2 || strcmp(para2,"--help")==0)
	{
		printf("%s %s\n",para1,arg);
		exit(EXIT_FAILURE);
	}
}

void err(char *fun)
{
    perror(fun);
    exit(errno);
}
